let { _navigateTo } = require("../../../utils/util");
Component({
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    active: 0,
    currentTab: 0,
    productList: [{
        id: 0,
        imgUrl: "../../../static/images/fruit1.png",
        title: "雪松瘦身2卷卫生纸1雪松瘦身2卷卫生纸1雪松瘦身2卷卫生纸1雪松瘦身2卷卫生纸1雪松瘦身2卷卫生纸1",
        exchange: 321,
        integral: 49.9,
        price: 78
      },
      { 
        id: 1,
        imgUrl: "../../../static/images/fruit2.png",
        title: "雪松瘦身2卷卫生纸2",
        exchange: 321,
        integral: 49.9,
        price: 78
      },
      {  
        id: 2,
        imgUrl: "../../../static/images/fruit1.png",
        title: "雪松瘦身2卷卫生纸1",
        exchange: 321,
        integral: 49.9,
        price: 78
      },
      { 
        id: 3,
        imgUrl: "../../../static/images/fruit2.png",
        title: "雪松瘦身2卷卫生纸2",
        exchange: 321,
        integral: 49.9,
        price: 78
      }
    ]
  },
  toGoodsDetail(e){
    console.log(e)
    // _navigateTo()
  },
  /**
   * 组件的方法列表
   */
  methods: {
    //点击切换
    clickTab: function (e) {
      console.log(e.target.dataset.current)
      var that = this;
      if (this.data.currentTab == e.target.dataset.current) {
        return false;
      } else {
        that.setData({
          currentTab: e.target.dataset.current,
        })
      }
    }
  }
})